import Vue from 'vue'
import App from './App.vue'
import store from '../../../../store'
import '../../../../plugins'
import '../../../../utils/permission'
import '@/assets/styles/common.scss'

import BetterScroll from '@/components/better-scroll/index'
// 注册全局组件
Vue.component('BetterScroll', BetterScroll)

//复制到粘贴板插件
import VueClipboard from 'vue-clipboard2'
VueClipboard.config.autoSetContainer = true
Vue.use(VueClipboard)

// 调试
import Vconsole from 'vconsole'
let vConsole = new Vconsole()
export default vConsole

Vue.config.productionTip = false

if (process.env.NODE_ENV === 'production') {
    window.apiready = () => {
        new Vue({
            store,
            render: h => h(App)
        }).$mount('#app')
    }
} else {
    new Vue({
        store,
        render: h => h(App)
    }).$mount('#app')
}

import { request } from '@/utils/request'

//加载位置
export function loadGreySamplePos(data, callback) {
    return request({
        url: "/grey_sample_pos/list_pos",
        method: "get",
        data,
        isYarn: true
    }, callback);
}

//扫码到位置
export function scanDetailToPos(data, callback) {
    return request({
        url: "/grey_sample_pos/scan_detail",
        method: "post",
        type: 'json',
        data,
        isYarn: true
    }, callback);
}